package cn.cslg.tieba.web;

import cn.cslg.tieba.domain.entity.Floor;
import cn.cslg.tieba.domain.entity.Tie;
import cn.cslg.tieba.service.WriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wu Zhenwei
 * 2017/11/21
 */
@RestController
public class WriterController {

    @Autowired
    private WriteService writeService;

    @PostMapping("/tie")
    public Tie publish(Tie tie, String content) {
        return writeService.addTie(tie, content);
    }

    @PostMapping("/floor")
    public Floor reply(Floor floor){
        return writeService.addFloor(floor);
    }

}
